<?php
$webRoot = $this->app->getWebRoot();
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>用户登录—IPv6网站升级</title>
    <!-- Le styles -->
    <!-- Bootstrap core CSS -->
    <?php
       css::import($webRoot . 'js/index/lib/bootstrap3.1.1/css/bootstrap.min.css');
       css::import($webRoot . 'js/index/lib/font-awesome-4.0.3/css/font-awesome.min.css');
	   
	   css::import($webRoot . 'js/index/css/base_x.css');
	   css::import($webRoot . 'js/index/css/index.css');
	   
	   js::import($webRoot . 'js/index/lib/html5shiv.js', $config->version, 'lt IE 9');
	   js::import($webRoot . 'js/index/lib/respond.js', $config->version, 'lt IE 9');
	   
	   js::import($webRoot . 'js/index/css/font-awesome-ie7.min.css', $config->version, 'lt IE 7');
	   
	   js::import($webRoot . 'js/index/js/json2.js', $config->version, 'lt IE 6');
	   js::import($webRoot . 'js/jquery-1.8.3.min.js', $config->version);
	?>
    
   <!-- <link rel="stylesheet" media="screen" href="media/lib/bootstrap3.1.1/css/bootstrap.min.css?v=6bb9f" />
    <link rel="stylesheet" media="screen" href="media/lib/font-awesome-4.0.3/css/font-awesome.min.css?v=fa686" />-->
    <!-- Custom styles for this template -->
    
    <!--<link rel="stylesheet" media="screen" href="media/css/base_x.css?v=ce6dc" />
    <link rel="stylesheet" media="screen" href="media/css/index.css?v=f788a" />-->
    
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="media/lib/html5shiv.js?v=62ac5" type="text/javascript"></script>
    <script src="media/lib/respond.js?v=e20a1" type="text/javascript"></script>
    <![endif]-->
    <!--[if IE 7]>
    <link rel="stylesheet" media="screen" href="media/css/font-awesome-ie7.min.css?v=4efc2" />
    <![endif]-->
    <!--[if IE 6]>
    <script src="media/js/json2.js?v=f97cd" type="text/javascript"></script>
    <![endif]-->
  </head>

  <body class="page_login" style="background:#014175">

    <!-- Static navbar -->
    <div class="navbar navbar-default navbar-static-top" role="navigation">
      <div class="container">
        <div class="navbar-header" style="padding-top:8px; margin-left:20px; margin-right:40px;">
          <a class="" href="<?php echo $webRoot;?>" ><img src="<?php echo $webRoot?>theme/default/img/logo.png"/></a>
        </div>
        <div class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
		<!--
            <li>
               <?php 
			       echo html::a($this->createLink('index'), '首页');
			   ?>
              </li>
            <li>
               <?php 
			       echo html::a($this->createLink('index','doc'), '帮助');
			   ?>
            </li>
             <li>
               <?php 
			       echo html::a($this->createLink('index','ipv6case'), '案例展示');
			   ?>
             </li>
            <li>
               <?php 
			       echo html::a($this->createLink('index','upcheck'), '升级检测');
			   ?>
             </li>
		-->
            <li class="active">
			  <?php 
			       echo html::a($this->createLink('overview','overview'), '控制面板');
			   ?>
            </li>
          </ul>
          <ul class="nav navbar-nav navbar-right ">
           <!-- <li id='nav_login' >
              <a href="/users/login">控制面板</a>
            </li>-->
            <!--<li id='nav_signup' ><a href="/uf_signup">注册</a></li>-->
           <!-- <li class="beian"><a target="_blank" href="/docs/beian.html"><span>备案服务</span></a></li>-->
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </div>    
<!-- <div class="container"></div> -->
<div class="container main">

  <div class="row">

    <div class="col-md-6 hidden-sm hidden-xs"><div id="left_img">
    <img src="<?php echo $webRoot?>theme/default/img/login_img.png"/>
    </div></div>

    <div class="col-md-6 form" user-check-url='/users/ajax_user_check' >
      <div style="background:#FFF; width:290px; padding:20px 15px; border-radius:8px;">
          <form role="form" method="POST" id="login_form">
              <div class="form-group" style="position: relative;">
              <div id="login-error" class="alert alert-danger hide">None</div>
              <label for="exampleInputEmail1">帐号登录</label>
              <input name="username" maxlength="32" class="form-control" id="id_username" 
              placeholder="用户名"
              tabindex="1"
              >
              <span class="fa fa-user input-icon"></span>
              <span id='id_username_status'></span>
            </div>
    
            <div class="form-group" style="position: relative;">
              <input name="password" maxlength="32" class="form-control"  placeholder="密码" type="password" id="id_password" tabindex="2">
              <span class="fa fa-lock input-icon"></span>
            </div>
             
            <div style="height:10px;"></div>
            <button type="button" class="btn btn-default btn-primary" id='btn-login' tabindex='5'>登录</button>
            <div style="color:#F00; font-weight:bold; display:none" id="error_info"></div>
          </form>
       </div>
      
    </div>

  </div>

</div>
<script type="text/javascript">
	$(document).ready(function(e) {
		$("#captcha_helper").click(function(){
		    genImg();
		});
		$("#gen_captcha").click(function(){
		    genImg();
		});
		function genImg(){
			$("#captcha").attr('src',"<?php echo $this->createLink('index','make_code');?>&r="+Math.random());
		}
        $("#btn-login").click(function(){
		   $.post("index.php?m=index&f=check_login",$("#login_form").serialize(),
				function(data){
					if(data=='failure'){//登录失败
						$("#error_info").html('用户名或密码错误').show();;
						setTimeout(function(){$("#error_info").hide()},3000)
					}else if(data=='forbidden'){//用户禁用
						$("#error_info").html('用户被禁用').show();
						setTimeout(function(){$("#error_info").hide()},3000)
				    }else if(data=='success'){
						location.href='<?php echo $this->createLink('overview','overview');?>';
					}else{
		
					}
				});
		});
    });
</script>
<div class="bottom-line"></div>
    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <footer>
      <div class="footer-content">
        <div class="nav">
          Copyright (C) 2014 www.zgaxzb.cn All Rights Reserved 版权所有 安信中保
        </div>
        <div class="nav">
          总部地址:北京市海淀区颐和园路福缘门甲1号&nbsp;&nbsp;对外地址:北京市丰台区大成路九号
        </div>
        <div class="nav">
        监督及举报电话：13811122625&nbsp;&nbsp; 010-57215921 &nbsp;&nbsp; 举报邮箱：axzbjcb@163.com &nbsp;&nbsp; 京ICP备14021453号
         </div>
      </div>
    </footer>
  </body>
</html>